import http from '@src/util/http';

let fixedPrefixPath = '/api/calendar';

/**
 * 日程人员冲突
 */
 export function getAgendaConfig(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaConfig/get`, params, false);
}

/**
 * 创建日程
 */
export function createAgenda(params: {} | undefined,query:'') {
  return http.post(`${fixedPrefixPath}/agendaInfo/create${query||''}`, params);
}

/**
 * 创建工单日程
 */
export function createTaskAgenda(params: {} | undefined) {
  return http.post('/api/task/outside/dd/task/createAndAllot', params);
}

/**
 * 工单日程详情
 */
export function getTaskAgendaInfo(params: {} | undefined) {
  return http.get('/api/task/outside/dd/task/get', params);
}

/**
 * 事件日程详情
 */
export function getEventAgendaInfo(params: {} | undefined) {
  return http.get('/event/view/info', params);
}

/**
 * 编辑日程
 */
export function editAgenda(params: {} | undefined,query:'') {
  return http.post(`${fixedPrefixPath}/agendaInfo/edit${query||''}`, params);
}

/**
 * 获取mini日历的日程  
 */
export function getMiniCalendarAgendas(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/mini/calendar`, params, false);
}

/**
 * 获取日历的日程  
 */
export function getAgendaCalendar(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/calendar`, params);
}

/**
 * 获取团队天日程
 */
export function getAgendaCalendarUser(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/calendar/user`, params);
}

/**
 * 获取日历的日程详情  
 */
export function getAgendaCalendarInfo(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaInfo/info`, params);
}

/**
 * 日程详情添加参与人  
 */
export function addAgendaUser(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/addUser`, params);
}

/**
 * 日程详情删除参与人  
 */
export function delAgendaUser(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/delUser`, params);
}

/**
 * 设置接、收拒绝【全部】日程
 */
export function setAgendaUserStatus(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/status`, params, false);
}
/**
 * 设置接、收拒绝日程
 */
export function setAgendaUserStatusOne(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/statusOne`, params);
}

/**
 * 删除日程
 */
export function deleteAgenda(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/delete`, params);
}
/**
 * 删除【全部】日程
 */
export function deleteAllAgenda(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/deleteAll`, params, false);
}

/**
 * 取消日程
 */
export function cancelAgenda(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agenda/cancel`, params);
}

/**
 * 工单日程人员冲突
 */
export function getTaskAgendaUsersTime(params: {} | undefined) {
  return http.post('/api/elasticsearch/outside/es/task/dispatch/list', params);
}
/**
 * 工单日程人员冲突数量
 */
 export function getTaskAgendaUsersTimeNum(params: any | undefined) {
  return http.post('/api/elasticsearch/outside/es/task/dispatch/num', params);
}

/**
 * 日程人员冲突
 */
export function getAgendaUsersTime(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/users/time`, params);
}
/**
 * 事件和通用日程人员冲突数量
 */
export function getAgendaUsersTimeNum(params: {} | undefined) {
  return http.post(`${fixedPrefixPath}/agendaUser/users/time/num`, params);
}
/**
 * 工单是否冲突校验
 */
 export function checkCalendarClash(params: {} | undefined) {
  return http.post('/api/task/outside/pc/task/check/calendar/clash', params);
}
/**
 * 工单冲突详情
 */
 export function calendarClashInfo(params: {} | undefined) {
  return http.post('/api/task/outside/pc/task/calendar/clash/info', params);
}
/**
 * 日程详情中删除的图标是否展示
 */
export function getOperation(params: {} | undefined) {
  return http.get('/api/task/outside/pc/task/check/task/operation', params);
}

/**
 * 日程详情中删除的图标是否展示
 */
export function getFixed() {
  return http.get('/calendar/check/work/fixed');
}

/**
 * 日程详情中删除的图标是否展示
 */
 export function queryByUserId(params: {} | undefined) {
  return http.post('/api/calendar/outside/calendar/scheduling/management/mobile/queryByUserId', params);
}
/**
 * 获取工单日程开通的具体时间
 */
export function getTaskOpenTime() {
  return http.post('/api/task/outside/pc/setting/plan/time/calculate');
}
